<template>
  <div></div>
</template>

<script>
import WSK from '../../../assets/websocker.js';

export default {
  name: 'cusWS',//该值会作为参数传出，修改前请留意
  
  data() {
    return {
      isDev: process.env.NODE_ENV == 'development',
      webSocket: null,//建立的连接
    };
  },
  methods: {
    initWebSocket: function () {
      let self = this;
      self.webSocket = new WSK({
        isAutoLink: true,
        host: 'ws://192.168.11.50:8181',
        timeHeart: 1000 * 3,
        strBegin: '',
        strEnd: '<EOF>',
        strHeart: 'KEEPALIVE',
        wsObj: Object.assign({},{}),
      });
      self.webSocket.start();
      return `${self.$options.name}初始化完成`;
    },
  },
  mounted() {
    this.initWebSocket();
  },
  beforeUpdate() { },
  updated() { },
  beforeDestroy() {},
  destroyed() { },

}
</script>

<style lang="less" scoped>
</style>